<?php

function Page($url, $name, $file, $onMenu = true, $script = "", $hasHead = false, $sidebar = "", $button = "") {
	return Array("url"=>$url, "name"=>$name, "file"=>$file, "onMenu"=>$onMenu, "script" => $script, "hasHead" => $hasHead, "sidebar"=>$sidebar, "button"=>$button);
}

$pages = Array(
		Page("home", "Home", "./content/home.php", false, "", false, "", ""),
		Page("checkinout", "Check In/Out", "./content/checkinout.php",true, "./scripts/checkinout.js", true, "", "back"),
		Page("share-story", "Share Story", "./content/sharestory.php", true, "./scripts/sharestory.js", true, "", "publish"),
		Page("report-lunch", "Report Lunch", "./content/lunch.php", true, "./scripts/lunch.js", true, "./content/lunch_sidebar.php", "submit"),
		Page("daily-log", "Report Daily Log", "./content/dailylog.php", true, "./scripts/dailylog.js", true, "", "submit"),
		Page("archives", "Archives","./content/archive.php", true, "./scripts/archive.js", true, "./content/archive_sidebar.php", "back" ));

$homePage = 0;

if (isset($_GET['pg'])) {
	foreach($pages as $page) {
		if ($_GET['pg'] == $page["url"]) {
			$currentPage = $page;
		}
	}
}

if (!isset($currentPage)) {
	$currentPage = $pages[$homePage];
}
include("./functions/mobile_detect.php");
include("./templates/page.php");

?>